//
//  WAInviteFriendController.m
//  WalkiOS
//
//  Created by qiaofanglu on 2019/11/5.
//  Copyright © 2019 Chenmuzhou. All rights reserved.
//

#import "WAInviteFriendController.h"

@interface WAInviteFriendController ()
@property (weak, nonatomic) IBOutlet UIImageView *erweimaImageVieww;
@property (weak, nonatomic) IBOutlet UIImageView *headImageVieww;
@property (weak, nonatomic) IBOutlet UILabel *IDLB;
@property (weak, nonatomic) IBOutlet UILabel *tuiguangLB;

@end
@implementation WAInviteFriendController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor colorWithHexString:@"FEE400"];
    if ([self.loginManager.userInfo.headimage hasPrefix:@"http"]) {
        [self.headImageVieww sd_setImageWithURL:[NSURL URLWithString:self.loginManager.userInfo.headimage] placeholderImage:[UIImage imageNamed:@"head_default_photo"]];
    }else if (self.loginManager.userInfo.headimage.length > 0) {
        self.headImageVieww.image = [UIImage stringToImage:self.loginManager.userInfo.headimage];
    }else{
        self.headImageVieww.image = [UIImage imageNamed:@"head_default_photo"];
    }
    
    self.tuiguangLB.text = [NSString stringWithFormat:@"推广码：%zd",self.loginManager.userInfo.userid];
    self.IDLB.text = [NSString stringWithFormat:@"我是:%@",self.loginManager.userInfo.nickname?:self.loginManager.userInfo.phone];
    
//    NSString *WAimageUrl = [NSString stringWithFormat:@"%@/code.jpg",kWNBaseURLString];
//    
    [self.erweimaImageVieww sd_setImageWithURL:[NSURL URLWithString:@"http://baby921.top/share_code.png"]];
}

- (IBAction)backAction:(id)sender {
    [self.navigationController popViewControllerAnimated:YES];
}

- (IBAction)shareACtion:(id)sender {
    UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:@"请截图保存并分享给好友" preferredStyle:UIAlertControllerStyleAlert];
    UIAlertAction *action1 = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
    }];
    [alert addAction:action1];
    [self presentViewController:alert animated:YES completion:nil];
}
@end
